﻿using FluentNHibernate.Mapping;

namespace Model
{
    public class Achievement
    {
        public virtual int ID { get; set; }
        public virtual int ExternalKey { get; set; }
        public virtual Faction Faction { get; set; }
        public virtual int Points { get; set; }
        public virtual string Title { get; set; }
        public virtual string Description { get; set; }
        public virtual AchievementCategory Category { get; set; }
        public virtual Achievement Previous { get; set; }
        public virtual string Icon { get; set; }
    }

    public class AchievementMapping : ClassMap<Achievement>
    {
        public AchievementMapping()
        {
            Id(x => x.ID);
            Map(x => x.Title);
            Map(x => x.Faction);
            Map(x => x.ExternalKey);
            Map(x => x.Points);
            Map(x => x.Description);
            Map(x => x.Icon);
            References(x => x.Category).Column("Category_id");
            References(x => x.Previous).Column("Previous_id");
        }
    }
}